Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for toolbox buttons #692

Merged
merged 6 commits into from
Feb 1, 2024
Merged

API for toolbox buttons #692

merged 6 commits into from
Feb 1, 2024

Conversation

modos189
Copy link
Contributor

@modos189 modos189 commented Jan 22, 2024

Created an API for adding buttons to a toolbox with backward compatibility with the old method. For testing purposes, the old toolbox is shown as semi-transparent

Using the new API to add buttons to Toolbox in core and plugins

@example
const buttonId = IITC.toolbox.addButton({
  label: 'AboutIITC',
  action: window.AboutIITC
});

@example
IITC.toolbox.addButton({
  id: 'mybtn',
  label: 'Test Button',
  action: () => alert('Clicked!')
});

@example
const buttonId = 'mybtn';
const isUpdated = IITC.toolbox.updateButton(buttonId, { label: 'Updated Button', action: () => console.log('New Action') });

closes #666

Copy link

github-actions bot commented Jan 22, 2024

🤖 Pull request artifacts

file commit
IITC_Mobile-test.apk 34379cf
test-0.37.1.20240130.155422.zip 34379cf

See build on website

@modos189 modos189 force-pushed the toolbox-api branch 6 times, most recently from 9fba961 to 1eac900 Compare January 22, 2024 07:08
@modos189 modos189 added the core label Jan 22, 2024
core/code/toolbox.js Outdated Show resolved Hide resolved
Copy link
Contributor

@xscreach xscreach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work

@modos189 modos189 merged commit a7d2664 into IITC-CE:master Feb 1, 2024
3 checks passed
@modos189 modos189 deleted the toolbox-api branch February 1, 2024 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants